import React, { Component } from 'react'

export default class App extends Component {
  render() {
    return (
      <div>
        <div>
          姓名：<input type="text" id="userName"/>
        </div>
        <div>
          密码：<input type="text" id="password"/>
        </div>
        <div>
          头像<input type="file" id="avatar"/>
        </div>
        <button onClick = { this.getData }>获取数据</button>
      </div>
    )
  }
  getData = () => {
    console.log({
      userName: document.getElementById('userName').value,
      password: document.getElementById('password').value
    })
  }
}
